package org.huangrui.spark.java.core.rdd.operate;

import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaSparkContext;

import java.util.Arrays;

/**
 * @Author hr
 * @Create 2024-10-16 18:29
 */
public class Spark02_Operate_Transform_Map_2 {
    public static void main(String[] args) {
        SparkConf conf = new SparkConf().setMaster("local[*]").setAppName("spark");
        JavaSparkContext jsc = new JavaSparkContext(conf);


        jsc.parallelize(Arrays.asList(1, 2, 3, 4), 2)
                .map(NumberTest::mul2)
                .collect()
                .forEach(System.out::println);


        jsc.close();
    }
}
